Manual: `F0af`_`[Link Establishment in Detail ↗`a8d24177d946de4f1f0a0fe1af9a1338:/page/blob.mu`g=reticulum|r=reticulum|ref=HEAD|path=docs/markdown/understanding.md|anchor=link-establishment-in-detail]`_`f
A `!link`! is a special `F0af`_`[destination`:/page/wiki.mu`path=Destination]`_`f type that provides a bidirectional, encrypted communication tunnel between two `F0af`_`[nodes`:/page/wiki.mu`path=Node]`_`f, over any number of hops.
It provides initiator anonymity, forward secrecy and more efficient encryption, and enables easy request-response messaging, large data transfers (`F0af`_`[resources`:/page/wiki.mu`path=Resource]`_`f) and more.`:cite-ref-0-1-0[`F5bf`_`[1`#cite-note-0-1]`_`f]
Links are very efficient. The total bandwidth cost of setting up a link is 3 packets (297 bytes) while the cost of keeping a link alive is 0.45 bits/second.`:cite-ref-0-1-1[`F5bf`_`[1`#cite-note-0-1]`_`f]
>>Contents
• `F0af`_`[Usage`#usage]`_`f
• `F0af`_`[See also`#see-also]`_`f
• `F0af`_`[References`#references]`_`f
>>Usage
With `F0af`_`[RNS`:/page/wiki.mu`path=RNS]`_`f:
`B100`F9d9# Initiator`f`b
`B100`F9d9link = RNS.Link(destination)`f`b
`B100`F9d9link.set_packet_callback(initiator_packet_received)`f`b
`B100`F9d9link.set_link_established_callback(initiator_link_established)`f`b
`B100`F9d9link.set_link_closed_callback(initiator_link_closed)`f`b
`B100`F9d9`f`b
`B100`F9d9# Responder`f`b
`B100`F9d9def client_connected(link):`f`b
`B100`F9d9 link.set_packet_callback(responder_packet_received)`f`b
`B100`F9d9 link.set_link_closed_callback(responder_link_closed)`f`b
`B100`F9d9 link.set_remote_identified_callback(remote_identified)`f`b
For a more comprehensive use case, see the Link example in the manual.
>>See also
• `F0af`_`[Resource`:/page/wiki.mu`path=Resource]`_`f
• `F0af`_`[Channel`:/page/wiki.mu`path=Channel]`_`f
>>References
`:cite-note-0-1`!1.`! `F0af`_`[↑`#cite-ref-0-1-0]`_`f `*Reaching the Destination`*, Manual. `F0af`_`[`a8d24177d946de4f1f0a0fe1af9a1338:/page/blob.mu`g=reticulum|r=reticulum|ref=HEAD|path=docs/markdown/understanding.md|anchor=reaching-the-destination] ↗`_`f
>>Reticulum concepts
`F0af`_`[Announce`:/page/wiki.mu`path=Announce]`_`f • `F0af`_`[Blackhole`:/page/wiki.mu`path=Blackhole]`_`f • `F0af`_`[Buffer`:/page/wiki.mu`path=Buffer]`_`f • `F0af`_`[Channel`:/page/wiki.mu`path=Channel]`_`f • `F0af`_`[Destination`:/page/wiki.mu`path=Destination]`_`f • `F0af`_`[Discovery`:/page/wiki.mu`path=Discovery]`_`f • `F0af`_`[Identity`:/page/wiki.mu`path=Identity]`_`f • `F0af`_`[Instance`:/page/wiki.mu`path=Instance]`_`f • `F0af`_`[Interface`:/page/wiki.mu`path=Interface]`_`f • `F0af`_`[Interface Access Code`:/page/wiki.mu`path=Interface_Access_Code]`_`f (IFAC) • Link • `F0af`_`[Network identity`:/page/wiki.mu`path=Network_identity]`_`f • `F0af`_`[Node`:/page/wiki.mu`path=Node]`_`f • `F0af`_`[Packet`:/page/wiki.mu`path=Packet]`_`f • `F0af`_`[Path`:/page/wiki.mu`path=Path]`_`f • `F0af`_`[Propagation node`:/page/wiki.mu`path=Propagation_node]`_`f • `F0af`_`[Resource`:/page/wiki.mu`path=Resource]`_`f • `F0af`_`[Stamp`:/page/wiki.mu`path=Stamp]`_`f • `F0af`_`[Transport node`:/page/wiki.mu`path=Transport_node]`_`f
>>Link
`!Source:`! `F0af`_`[Link.py ↗`a8d24177d946de4f1f0a0fe1af9a1338:/page/blob.mu`g=reticulum|r=reticulum|ref=HEAD|path=RNS/Link.py]`_`f
`!API:`! `F0af`_`[RNS.Link ↗`a8d24177d946de4f1f0a0fe1af9a1338:/page/blob.mu`g=reticulum|r=reticulum|ref=HEAD|path=docs/markdown/reference.md|anchor=RNS.Link]`_`f